package com.myfarm.controller;

import com.myfarm.http.WebResponse;
import com.myfarm.service.UserTestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;


@RestController
@Slf4j
@RequestMapping("/user")
public class UserTestController {

    //private final Logger log = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private UserTestService testService ;

    @GetMapping("/test")
    public WebResponse test() throws SQLException {
        WebResponse webResponse = new WebResponse();
        Object data = testService.test();
        webResponse.success("200",data);
        return webResponse;
    }
    @GetMapping("/test2")
    public WebResponse test2() throws SQLException {
        WebResponse webResponse = new WebResponse();
        Object data = testService.test2();
        webResponse.success("6666666",data);
        return webResponse;
    }

}
